//
//  CollectionViewCell.m
//  MyProject
//
//  Created by yun on 2018/7/27.
//  Copyright © 2018年 yun. All rights reserved.
//

#import "CollectionViewCell.h"
#import "TurntableCollectionViewLayout.h"

@implementation CollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    [super applyLayoutAttributes:layoutAttributes];
    TurntableUICollectionViewLayoutAttributes *layout = (TurntableUICollectionViewLayoutAttributes *)layoutAttributes;
    self.layer.anchorPoint = layout.anchorPoint;
    self.center = CGPointMake(self.center.x, self.center.y + (layout.anchorPoint.y - 1)*CGRectGetHeight(self.bounds));
}


@end
